public class TestArray {
    public  static  void printArray(int [] array){
        for (int i=0;i< array.length;i++){
            System.out.print(array[i]+" ");
        }
    }
    public static void main(String[] args) {
/*//        double[] doubleArray= new double[10]; //Java语言使用new操作符来创建数组，语法如下： new 一个新的类型数组对象赋给 xxxx
        int size = 10;
        double sum=0;
        // 定义数组
        double[] myList = new double[size];
        myList[0] = 5.6;
        myList[1] = 4.5;
        myList[2] = 3.3;
        myList[3] = 13.2;
        myList[4] = 4.0;
        myList[5] = 34.33;
        myList[6] = 34.0;
        myList[7] = 45.45;
        myList[8] = 99.993;
        myList[9] = 11123;
        *//*for(double mylis :myList){
            sum+=mylis;
        }
        System.out.println(sum);*//*
        for (int i=0;i<size;i++){
            sum+=myList[i];
        }
        System.out.println(sum);*/
        double[] Array = {1.2, 2.3, 3.4, 5.2};

        //print array Array members;
        for (int i = 0; i < Array.length; i++) {
            System.out.print(Array[i] + " ");
        }
        System.out.println();
        //calutor Array total Sum
        double arraySum = 0;
        for (int i = 0; i < Array.length; i++) {
            arraySum += Array[i];
        }
        System.out.println(arraySum);
        //choose the max of array;

        double max=Array[0];
        for (int i=0;i<Array.length;i++) {
            if (Array[i]>max)max=Array[i];
        }
        System.out.println(max);
        printArray(new int []{1,23,4,5,45,46,4,64,64,6,4});
    }
}

